package com.lg.erp.controller.zhangchaofu;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lg.erp.entity.JsonResult;
import com.lg.erp.entity.zhangchaofu.CTCargoArea;
import com.lg.erp.service.zhangchaofu.ICTCargoAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CTCargoAreaController {

    @Autowired
    private ICTCargoAreaService cargoAreaService;

    @GetMapping("/cargoAreas")
    public JsonResult getGoodsName(String wareId){
        System.out.println(wareId);
        List<CTCargoArea> cargoAreas = cargoAreaService.list(
                new QueryWrapper<CTCargoArea>().lambda()
                        .eq(CTCargoArea::getWareId,wareId));
        cargoAreas.forEach(System.out::println);
        return new JsonResult(1,"ok",cargoAreas);
    }

}
